﻿Public Class FrmStart

    Private Sub FrmStart_Activated(sender As Object, e As System.EventArgs) Handles Me.Activated

        If FrmConnection.ComboBoxNom.Text = "" Then
            MenuIdent.Text = "..........."
        Else
            MenuIdent.Text = FrmConnection.ComboBoxNom.Text.ToUpper
        End If
    End Sub

    Private Sub FrmStart_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        FrmConnection.Show()
        Me.WindowState = FormWindowState.Maximized
        Dim ctl As Control
        Dim ctlMDI As MdiClient

        ' Loop through all of the form's controls looking
        ' for the control of type MdiClient.
        For Each ctl In Me.Controls
            Try
                ' Attempt to cast the control to type MdiClient.
                ctlMDI = CType(ctl, MdiClient)

                ' Set the BackColor of the MdiClient control.
                ctlMDI.BackColor = Color.Black


            Catch exc As InvalidCastException
                ' Catch and ignore the error if casting failed.
            End Try
        Next

    End Sub
    Private Sub ListeToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles ListeClientToolStripMenuItem1.Click

        FrmListClient.Show()
    End Sub

    Private Sub ListeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ListeDepannagesToolStripMenuItem.Click

        FrmListDepannage.Show()
    End Sub

    Private Sub ModifToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles RechercheDepannageToolStripMenuItem.Click
        FrmModifDepannage.Show()
    End Sub

    Private Sub AjoutToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles AjoutDepannageToolStripMenuItem.Click

        FrmAjoutDep.Show()
    End Sub

    Private Sub RechercheToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles RechercheClientToolStripMenuItem1.Click
        FrmRechModifSuppClient.Show()
    End Sub

    Private Sub AjoutParNomClientToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
    End Sub

    Private Sub QuitterToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles QuitterToolStripMenuItem.Click
        Close()
    End Sub

    Private Sub ListeToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs) Handles ListeTarifsToolStripMenuItem2.Click
        FrmListeTravaux.Show()
    End Sub

    Private Sub AjoutModifSuppToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AjoutModifSuppTravauxToolStripMenuItem.Click
        FrmAMSTravaux.Show()
    End Sub


    Private Sub ConnectToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
        FrmConnection.Show()
    End Sub

    Private Sub ListeToolStripMenuItem3_Click(sender As System.Object, e As System.EventArgs) Handles ListeMaterielToolStripMenuItem3.Click
        FrmListeMateriel.Show()
    End Sub

    Private Sub AjoutSupprModifToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AjoutSupprModifMaterielToolStripMenuItem.Click
        FrmAMSMateriel.Show()
    End Sub

    Private Sub ModificationDuFormulaireToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ModificationDuFormulaireDepannageToolStripMenuItem.Click
        FrmModifFormulaire.Show()
    End Sub

    Private Sub AjoutToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs)
        FrmRecapAjoutDep.Show()
    End Sub

    Private Sub AjoutCliToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
    End Sub

    Private Sub ModifToolStripMenuItem_Click_1(sender As System.Object, e As System.EventArgs)
        FrmRecapModifDep.Show()
    End Sub

    Private Sub DddToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
    End Sub

    Private Sub InterventionsEnCoursToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles InterventionsEnCoursToolStripMenuItem.Click
        FrmDepEnCours.Show()
    End Sub

    Private Sub InterventionsTerminéesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles InterventionsTerminéesToolStripMenuItem.Click
        FrmDepTerm.Show()
    End Sub

    Private Sub SeDéconnecterToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SeDéconnecterToolStripMenuItem.Click
        DepanageToolStripMenuItem.Enabled = False
        ClientToolStripMenuItem.Enabled = False
        TravauxEtTarifToolStripMenuItem.Enabled = False
        MatérielToolStripMenuItem.Enabled = False
        EtatDesInterventionsToolStripMenuItem.Enabled = False
        MenuIdent.Text = "..........."
    End Sub

    Private Sub SeConnecterToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SeConnecterToolStripMenuItem.Click
        FrmConnection.TextBoxMDP.Text = ""
        FrmConnection.ComboBoxNom.Text = ""
        FrmConnection.Show()

    End Sub


    Private Sub MenuIdent_Click(sender As System.Object, e As System.EventArgs) Handles MenuIdent.Click, MenuIdent.Click
        If MenuIdent.Text = "..........." Then
            FrmConnection.Show()
        ElseIf (MessageBox.Show("Voulez-vous vous déconnecter ?", "Deconnexion....", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes) Then
            FrmConnection.Close()
            MenuIdent.Text = "..........."
            DepanageToolStripMenuItem.Enabled = False
            ClientToolStripMenuItem.Enabled = False
            TravauxEtTarifToolStripMenuItem.Enabled = False
            MatérielToolStripMenuItem.Enabled = False
            EtatDesInterventionsToolStripMenuItem.Enabled = False


        End If
    End Sub

    Private Sub PieceDOcasionToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PieceDOcasionToolStripMenuItem.Click
    End Sub

    Private Sub ModifMotDePasseToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ModifMotDePasseToolStripMenuItem.Click
        FrmModifMdp.Show()
    End Sub

    Private Sub ModifAdminToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ModifAdminToolStripMenuItem.Click
        FrmModifMdpAdmin.Show()
    End Sub

    Private Sub RechercheToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles RechercheToolStripMenuItem.Click
        FrmRecherche.Show()
    End Sub

    Private Sub AjoutToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AjoutToolStripMenuItem.Click
        Importer.Show()

    End Sub
End Class